package com.bazaaroid.mobile.rest.model.partner;

import java.util.ArrayList;

public class ProductItem {
	public static String KEY = "key";
	public static String NAME = "name";
	public static String DESC = "description";
	public static String PRICE = "price";
	public static String CURRENCY = "currency";
	public static String CATEGORIES = "categories";
	public static String DISCOUNT = "discount";
	public static String LOCATIONS = "locations";
	public static String PARTNER = "partner";
	public static String TAGS = "tags";
	
	private String key;
	private String name;
	private String description;
	private String price;
	private String currency;
	private ArrayList<CategoryItem> categories;
	private DiscountItem discount;
	private ArrayList<LocationItem> locations;
	private PartnerItem partner;
	private ArrayList<TagItem> tags;
	public void setKey(String key) {
		if(key.contains("Partner(") && key.contains(")/Product(") && key.contains(")"))
		{
			key = key.replace("Partner(", "");
			key = key.replace("Product(", "");
			key = key.replace(")", "");
			// 16001/101
			int index = key.indexOf("/");
			key = key.substring(++index, key.length());
		}
		else if(key.contains("Product(") && key.contains(")"))
		{
			key = key.replace("Product(", "");
			key = key.replace(")", "");
		}
		this.key = key;
	}
	public String getKey() {
		return key;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getName() {
		return name;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getDescription() {
		return description;
	}
	public void setPrice(String price) {
		this.price = price;
	}
	public String getPrice() {
		return price;
	}
	public void setCurrency(String currency) {
		this.currency = currency;
	}
	public String getCurrency() {
		return currency;
	}
	public void setCategories(ArrayList<CategoryItem> categories) {
		this.categories = categories;
	}
	public ArrayList<CategoryItem> getCategories() {
		return categories;
	}
	public void setDiscount(DiscountItem discount) {
		this.discount = discount;
	}
	public DiscountItem getDiscount() {
		return discount;
	}
	public void setLocations(ArrayList<LocationItem> locations) {
		this.locations = locations;
	}
	public ArrayList<LocationItem> getLocations() {
		return locations;
	}
	public void setPartner(PartnerItem partner) {
		this.partner = partner;
	}
	public PartnerItem getPartner() {
		return partner;
	}
	public void setTags(ArrayList<TagItem> tags) {
		this.tags = tags;
	}
	public ArrayList<TagItem> getTags() {
		return tags;
	}
}
